/**
 * 
 */
package com.roshan.web.service;

import java.util.List;
import java.util.Map;

import com.roshan.web.dto.ForgotPasswordDetail;
import com.roshan.web.dto.LabelValue;
import com.roshan.web.dto.RegisterUserDetail;
import com.roshan.web.dto.UpdateExpiredPassword;
import com.roshan.web.dto.UpdateExpiredPasswordDetail;
import com.roshan.web.dto.UpdatePasscode;
import com.roshan.web.dto.UpdatePassword;
import com.roshan.web.dto.UpdateUser;
import com.roshan.web.dto.UpdateUserDetail;
import com.roshan.web.dto.User;
import com.roshan.web.dto.UserDetail;
import com.roshan.web.dto.UserProfile;
import com.roshan.web.dto.UserSecurityProfile;
import com.roshan.web.security.exceptions.ResourceNotFoundException;

// TODO: Auto-generated Javadoc
/**
 * The Interface IUserService.
 * 
 * @author roshan
 */
public interface IUserService {

    /**
     * Gets the device type list by tenant.
     * 
     * @param tenant the tenant
     * @return the device type list
     */
    List<LabelValue> getDeviceTypeList(String tenant);

    /**
     * Gets the device type list.
     * 
     * @param user the user
     * @return the device type list
     */
    List<LabelValue> getDeviceTypeList(User user);

    /**
     * Register user.
     * 
     * @param userProfile the user profile
     * @return the register user detail
     */
    RegisterUserDetail registerUser(UserProfile userProfile);

    /**
     * Retrieve user.
     * 
     * @param userUri the user uri
     * @param tenantUri the tenant uri
     * @param partnerUri the partner uri
     * @return the user detail
     */
    UserDetail retrieveUser(String userUri, String tenantUri, String partnerUri);

    /**
     * Update user.
     * 
     * @param updateUser the update user
     * @return the update user detail
     */
    UpdateUserDetail updateUser(UpdateUser updateUser);

    /**
     * Update password.
     * 
     * @param updatePassword the update password
     * @return true, if successful
     */
    String updatePassword(UpdatePassword updatePassword);

    /**
     * Update expired user password.
     * 
     * @param updateExpiredPassword the update expired password
     * @return the string
     */
    String updateExpiredUserPassword(UpdateExpiredPassword updateExpiredPassword);

    /**
     * Update passcode.
     * 
     * @param updatePasscode the update passcode
     * @return the string
     */
    String updatePasscode(UpdatePasscode updatePasscode);

    /**
     * Retrieve user security questions.
     * 
     * @param userUri the user uri
     * @param tenantUri the tenant uri
     * @param partnerUri the partner uri
     * @return the list
     */
    List<String> retrieveUserSecurityQuestions(String userUri, String tenantUri, String partnerUri);

    /**
     * Update security questions.
     * 
     * @param mfaQuestionAnswers the mfa question answers
     * @param currentLoginUserUri the current login user uri
     * @param tenantProfileUri the tenant profile uri
     * @param partnerProfileUri the partner profile uri
     * @return true, if successful
     */
    boolean updateSecurityQuestions(Map<String, String> mfaQuestionAnswers, String currentLoginUserUri,
            String tenantProfileUri, String partnerProfileUri);

    /**
     * Retrieve users by email address.
     * 
     * @param email the email
     * @param tenantUri the tenant uri
     * @param partnerUri the partner uri
     * @return the list
     * @throws RuntimeException the runtime exception
     * @throws ResourceNotFoundException the resource not found exception
     */
    List<UserSecurityProfile> retrieveUsernamesByEmailAddress(String email, String tenantUri, String partnerUri)
            throws RuntimeException, ResourceNotFoundException;

    /**
     * Retrieve forgot password request.
     * 
     * @param partnerUri the partner uri
     * @param tenantUri the tenant uri
     * @param userUri the user uri
     * @return the forgot password detail
     * @throws RuntimeException the runtime exception
     */
    ForgotPasswordDetail retrieveForgotPasswordRequest(String partnerUri, String tenantUri, String userUri, String type)
            throws RuntimeException;

    UpdateExpiredPasswordDetail retrieveUpdateExpiredPasswordRequest(final String userUri) throws RuntimeException;

    /**
     * Checks if is email address exists.
     * 
     * @param email the email
     * @param tenantUri the tenant uri
     * @param partnerUri the partner uri
     * @param userUri the user uri
     * @return the boolean
     */
    Boolean isEmailAddressExists(String email, String tenantUri, String partnerUri, String userUri);

    /**
     * Checks if is email address exists.
     * 
     * @param email the email
     * @param tenantUri the tenant uri
     * @param partnerUri the partner uri
     * @return the user uri list
     */
    List<String> isEmailAddressExists(String email, String tenantUri, String partnerUri);

}
